Passed
Branch master (631cc3)
by Stephan
33:03
created

Lingo.js ➔ $   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 28

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 28
rs 8.8571

1 Function

Rating   Name   Duplication   Size   Complexity  
B Lingo.js ➔ ... ➔ $(ꞌ.mw-lingo-termꞌ).each 0 24 1
1
/**
2
 * Javascript handler for the Lingo extension
3
 *
4
 * This file is part of the MediaWiki extension Lingo.
5
 *
6
 * @copyright 2011 - 2018, Stephan Gambke
7
 * @license   GNU General Public License, version 2 (or any later version)
8
 *
9
 * The Lingo extension is free software: you can redistribute it and/or modify
10
 * it under the terms of the GNU General Public License as published by the Free
11
 * Software Foundation; either version 2 of the License, or (at your option) any
12
 * later version.
13
 *
14
 * The Lingo extension is distributed in the hope that it will be useful, but
15
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17
 * details.
18
 *
19
 * You should have received a copy of the GNU General Public License along
20
 * with this program. If not, see <http://www.gnu.org/licenses/>.
21
 *
22
 * @author Stephan Gambke
23
 *
24
 * @file
25
 * @ingroup Lingo
26
 */
27
28
/*global confirm */
29
30
( function ( $ ) {
31
32
	'use strict';
33
34
	$( function ( $ ) {
35
36
		$( '.mw-lingo-term' ).each( function ( index ) {
0 ignored issues
show
Unused Code introduced by
The parameter index is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
37
38
			var termId = $(this).attr( 'data-lingo-term-id');
39
40
			var tooltip = $( '#' + termId );
41
42
			$( this ).qtip( {
43
				content : tooltip.html(),
44
				position: {
45
					my: 'top left',  // Position tooltip's top left...
46
					at: 'bottom left' // at the bottom left of target
47
				},
48
				hide    : {
49
					fixed: true,
50
					delay: 300
51
				},
52
				style   : {
53
					classes: tooltip.attr( 'class' ) + ' qtip-shadow',
54
					def    : false
55
				}
56
57
			} );
58
59
		} );
60
61
	} );
62
}( jQuery ) );
63